package com.hua.api.modules.finance.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;


@Entity
@Data
@Table(name="user_account_charge")
public class UserAccountCharge implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    @ApiModelProperty(value = "id")
    private Integer id;

    @Column(name = "`out_trade_no`")
    @ApiModelProperty(value = "充值订单号")
    private String outTradeNo;

    @Column(name = "`Third_trade_no`")
    @ApiModelProperty(value = "第三方的订单号")
    private String thirdTradeNo;

    @Column(name = "`user_id`")
    @ApiModelProperty(value = "充值|提现用户")
    private Integer userId;

    @Column(name = "`amount`")
    @ApiModelProperty(value = "充值|提现金额")
    private Double amount;

    @Column(name = "`created_time`")
    @ApiModelProperty(value = "创建时间")
    private Date createdTime;

    @Column(name = "`update_time`")
    @ApiModelProperty(value = "完成时间")
    private Date updateTime;

    @Column(name = "`type`")
    @ApiModelProperty(value = "充值 income |提现 payto")
    private String type;

    @Column(name = "`alipay_name`")
    @ApiModelProperty(value = "支付宝账号名")
    private String alipayName;

    @Column(name = "`alipay_account`")
    @ApiModelProperty(value = "支付宝账号")
    private String alipayAccount;

    @Column(name = "`bank_name`")
    @ApiModelProperty(value = "银行名称")
    private String bankName;

    @Column(name = "`bank_account`")
    @ApiModelProperty(value = "银行账号")
    private String bankAccount;

    @Column(name = "`bank_user`")
    @ApiModelProperty(value = "银行用户")
    private String bankUser;

    @Column(name = "`charge_type`")
    @ApiModelProperty(value = "支付方式 目前只支持 alipay")
    private String chargeType;

    @Column(name = "`remarks`")
    @ApiModelProperty(value = "备注")
    private String remarks;

    @Column(name = "`state`")
    @ApiModelProperty(value = "状态")
    private Integer state;

    public void copy(UserAccountCharge source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
